package com.my;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

import com.my.page.LoginController;
import com.my.page.Menu;
import com.my.toolkit.JsonUtil;

@SpringBootApplication
public class App {
	public static ConfigurableApplicationContext context;

	public static void main(String[] args) {
		context = SpringApplication.run(App.class, args);

	}
	
	@Bean
	public JsonUtil josnUtil() {
		return new JsonUtil();
	}
	
	
	@Bean
	public LoginController loginController() {
		Menu menu=new Menu();
		menu.add("图书管理", "/demo/book/index");
		LoginController con=new LoginController("hello",menu);
		return con;
	}
	
	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
}